﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace BooksList
{
    public class Category
    {
        public ObservableCollection<Books> b{get;set;}
        public string c{get;set;}
        public Category(String category_name)
        {
            b = new ObservableCollection<Books>();
            c = category_name;
            switch (c)
            {
                case "Silverlight":
                    b.Add((Books.GetBooks()[0]));
                    b.Add((Books.GetBooks()[1]));

                    break;
                case "ASP.NET":
                    b.Add((Books.GetBooks()[2]));
                    b.Add((Books.GetBooks()[3]));
                    break;
            }

        }
    }

    public class Books
    {
        public string Title { get; set; }
        public DateTime PublishDate { get; set; }
        public string Discription { get; set; }
        public decimal Price { get; set; }
        //public String Category { get; set; } 

        public static ObservableCollection<Books> GetBooks()
        {
            ObservableCollection<Books> bks = new ObservableCollection<Books>();

            bks.Add(
                new Books()
                {
                    Title = "PowerLine Equipping",
                    PublishDate = new DateTime(2008, 7, 30, 2, 58, 11),
                    Discription="hahahahahaha",
                    Price=1223,
                    
                });

            bks.Add(
            new Books()
            {
                Title = "Silverlight at Gamefest",
                PublishDate = new DateTime(2008, 7, 23, 6, 28, 9),
                 Discription=null,
                 Price=2343,
                

            });

            bks.Add(
                new Books()
                {
                    Title = "Providing Startup Parameters",
                    PublishDate = new DateTime(2008, 7, 18, 6, 12, 19),
                    Discription = "hahahahahaha",
                    Price=4342,
                    

                });

            bks.Add(
                new Books()
                {
                    Title = "Low Cost SSL Providers",
                    PublishDate = new DateTime(2008, 7, 16, 9, 30, 9),
                    Discription = "hahahahahaha",
                    Price=4222,
                   

                });
            return bks;
        }
    }
}